
MD := lua mkdir.lua
RM := rm -f

bookdemo: bookdemo.pas
	$(MD) units
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
bug220628: bug220628.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
bug221229: bug221229.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
chessboarddemo: chessboarddemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
chessgamedemo: chessgamedemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
fendemo: fendemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
fenfilterdemo: fenfilterdemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
movelistdemo: movelistdemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err | tee $@.out
perft: perft.pas
	fpc @extrafpc.cfg $<
	./$@ 4 2> $@.err > $@.out
pgnreaddemo: pgnreaddemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
	./$@ files/sample960.pgn 2> $@-sample960.err > $@-sample960.out
pgnreadsimpledemo: pgnreadsimpledemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
	./$@ files/sinqcup17.pgn 2> $@-sinqcup17.err > $@-sinqcup17.out
	./$@ files/Adam-Hair-12moves-397457.pgn 2> $@-Adam-Hair-12moves-397457.err > $@-Adam-Hair-12moves-397457.out
simpledemo: simpledemo.pas
	fpc @extrafpc.cfg $<
	./$@ 2> $@.err > $@.out
clean:
	$(RM) units/*.o
	$(RM) units/*.ppu
	$(RM) *demo
	$(RM) bookdemo
	$(RM) bug220628
	$(RM) perft
clean2:
	$(RM) units/*.o
	$(RM) units/*.ppu
	$(RM) *.o
	$(RM) *.ppu
	$(RM) ../*.o
	$(RM) ../*.ppu
	$(RM) *demo
	$(RM) bookdemo
	$(RM) bug220628
	$(RM) perft
	$(RM) *.err
	$(RM) *.out
.PHONY: clean clean2
